/******************************************************************************
 * Copyright (C) 2014-2020 Hugewing Co.,Ltd
 * All Rights Reserved.
 * 本软件为杭州巨翼科技开发研制。未经本公司正式书面同意，其他任何个人、团体
 * 不得使用、复制、修改或发布本软件.
 *****************************************************************************/
package com.sdkj.interceptor;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;

//import com.hy.initconfig.session.SessionInfo;
//import com.hy.util.CommonUtils;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
import com.sdkj.utils.DateUtil;

/**
 * 登录拦截器
 * 
 */
public class LoginInterceptor extends MethodFilterInterceptor {

		private static final Logger logger = Logger.getLogger(LoginInterceptor.class);

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	protected String doIntercept(ActionInvocation actionInvocation) throws Exception {
//		SessionInfo sessionInfo = CommonUtils.getSessionInfo();
//		if (sessionInfo == null) {
//			ServletActionContext.getRequest().setAttribute("msg", "您还没有登录或登录已超时，请重新登录，然后再刷新本功能！");
//			return "noSession";
//		}
		HttpServletRequest req=ServletActionContext.getRequest();  
//		logger.error(DateUtil.dt14FromDate(new Date())+" url : "+req.getRequestURI() +" params : "+req.getParameterMap());
		return actionInvocation.invoke();
	}

}
